﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewRequest.aspx.cs" Inherits="UseCar.NewRequest" %>

<%@ Register Src="../../Processes/ProcessControl/UserInfo.ascx" TagName="UserInfo"
    TagPrefix="ui" %>
<%@ Register Src="../../Processes/ProcessControl/ApprovalHistory.ascx" TagName="ApprovalHistory"
    TagPrefix="ah" %>
<%@ Register Src="../../Processes/ProcessControl/Attachments.ascx" TagName="Attachments"
    TagPrefix="attach" %>
<%@ Register Src="../../Processes/ProcessControl/ButtonList.ascx" TagName="ButtonList"
    TagPrefix="btn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用车申请</title>
    <link rel="Stylesheet" href="../../App_Themes/formValidator2.5/css/validationEngine.jquery.css" />
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
        jQuery(document).ready(function () {
            //禁用带出信息控件的编辑事件
            $("#fld_CARNAME").keydown(function (event) {
                return false;
            });
        })

        function beforeSubmit() {

            var incident = $("#UserInfo1_incident").text();
            $("#txtHide").val("");
            var b = true;
            var start = $("#fld_USESTART").val();
            var CarId = $("#fld_CARID").val();
            var end = $("#fld_USEEND").val();
            $.ajax({
                type: "post",
                async: false,
                url: "FindCar.ashx?CarId=" + CarId + "&start=" + start + "&end=" + end + "&incident=" + incident,
                success: function (msg) {
                    if (msg != "") {
                        alert(msg + "已被占用！！！");
                        $("#txtHide").val("已被占用");
                    }
                }
            });
            if ($("#txtHide").val() == "已被占用") {
                b = false;
            }
            return b;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="row">
            <ui:userinfo id="UserInfo1" processtitle="用车申请" tablename="PROC_USECAR"
                runat="server"></ui:userinfo>
        </div>
        <div class="row">
            <table class="table table-condensed table-bordered">
                <tr>
                    <td class="banner" colspan="4">
                        详细信息
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        车辆名称：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_CARNAME" ReadOnly="false" runat="server" CssClass="validate[required]"></asp:TextBox>
                        <asp:TextBox ID="fld_CARID" style="display:none;" runat="server"></asp:TextBox>
                        <input id="btn_FindCar" type="button" value="查询" class="btn" onclick="selectCar('fld_CARNAME', 'fld_CARID')" />
                    </td>
                    <td class="td-label">
                        用车人数：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_USERNUM" money="int" runat="server" CssClass="validate[required,custom[integer]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        是否出差：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:DropDownList ID="fld_ISTRAVEL" CssClass="validate[required]" runat="server">
                            <asp:ListItem Value=""></asp:ListItem>
                            <asp:ListItem Value="是">是</asp:ListItem>
                            <asp:ListItem Value="否">否</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="td-label">
                        是否节假日用车：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:DropDownList ID="fld_ISHOLIDAY" CssClass="validate[required]" runat="server">
                            <asp:ListItem Value=""></asp:ListItem>
                            <asp:ListItem Value="是">是</asp:ListItem>
                            <asp:ListItem Value="否">否</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        用车开始时间：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_USESTART" runat="server" OnClick="WdatePicker()" CssClass="Wdate validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        用车结束时间：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_USEEND" runat="server" OnClick="WdatePicker()" CssClass="Wdate validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        事由及地点：<span class="red">*</span>
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox ID="fld_REASON" runat="server" Width="87%" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div class="row">
            <attach:attachments id="Attachments1" runat="server"></attach:attachments>
        </div>
        <div class="row">
            <ah:approvalhistory id="ApprovalHistory1" showaction="true" runat="server"></ah:approvalhistory>
        </div>
        <div class="row">
        </div>
    </div>
    <btn:buttonlist id="ButtonList1" runat="server"></btn:buttonlist>
    <div class="divHide" style="display:none;">
        <asp:TextBox ID="txtHide" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>
